@extends('admin/layout')
@section('title','商品管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    商品列表
    <small>商品属性列表</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="{{asset('admin/index')}}"><i class="fa fa-th"></i> 管理首页</a></li>
    <li><i class="fa fa-shopping-cart"></i> 商品管理</li>
    <li><a href="{{asset('admin/product')}}"><i class="fa fa-list-ul"></i> 商品属性列表</a></li>
    <li class="active">商品属性列表</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-12">
      <!-- box start -->
      <div class="box box-info">
      <div class="box-header with-border">
        <h3 class="box-title"><i class="fa fa-list-ul"> 商品属性列表</i></h3>
      </div>
      @if(session('add_pro_success'))
        <div class="alert alert-success">
          <ul>           
            <li>{{session('add_pro_success')}}</li>
          </ul>
        </div>   
      @endif
      <div class="box-body">
        <div class="row">
          <div class="col-md-3">
            <button id="addattr" class="btn bg-orange">添加属性</button>
            <script>
              $('#addattr').on('click',function(){
                window.location.href="/admin/productattr/{{$pro_id}}";
              });
            </script>
          </div>
        </div>
        <div class="row">
          &nbsp;
        </div>
        <div class="row">
          &nbsp;
        </div>
        <div class="table-responsive">
        <table id="member_list" class="table table-bordered table-striped text-center">
          <thead>
          <tr>
            <!--<th>选择</th>-->
            <!--<th>序号</th>-->
            <th>属性关键字</th>
            <th>色系</th>
            <th>库存数</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
            @foreach($attr as $v)
            <tr>
              <!--<td></td>-->
              <td>{{$v->keyword}}</td>
              <td style="background-color:{{$v->color_hex_code}};"></td>
              <td>{{$v->attr_stocknum}}</td>
              <td>
                <a href="/admin/productattr/{{$pro_id}}/edit/{{$v->cosir_id}}">
                <button type="button" class="btn-xs btn-warning">详情/更改</button>
              </a>
              </td>
            </tr>
            @endforeach
          </tbody>
          <!--
          <tfoot>
          <tr>
            <th colspan="3">
              <button type="button" class="btn-xs btn-primary">全选</button>
              <button type="button" class="btn-xs btn-primary">不选</button>
              <button type="button" class="btn-xs btn-primary">反选</button>
            </th>
            <th colspan="5"></th>
            <th colspan="3">
              <button type="button" class="btn-xs btn-info">发送全体消息</button>
            </th>
          </tr>
          </tfoot>
          -->
        </table>
        </div>
      </div>
      <!-- /.box-body -->
      <!-- /.box -->        
    </div>
  </div>
</section>
<!-- /.content -->
@stop